package classDuoTai01;

public class Person {
    private String name;
    private int age;

    public void show() {
        System.out.println("我是人类");
    }


    public Person() {
        this("无有名字", 520);
		 /*
		调用本类的有参构造方法
		这样实现了无参构造对象时候，对象成员有初始化默认值
		this("无名",1);必须放在第一行，否则报错
		this();不能和this("无名",1);同时存在，否则报错
		*/
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
